import Vue from 'vue'
import Vuex from 'vuex'
import { homelink } from "@/api/homeapi.js"
Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        arr1: [],
        arr2: [],
        arr3: [],
    },
    mutations: {
        upstate(state, playload) {
            state.arr1 = playload;
        },
        xshow(state, playload) {
            state.arr2 = playload;
        },
        xlist(state, playload) {
            state.arr3 = playload;
        }
    },
    actions: {
        xaxios(context) {
            homelink("/list/value", "get").then((ok) => {
                context.commit("upstate", ok.data.listZ);
            }).catch((err) => {
                console.log(err);
            })
        }
    },
    modules: {}
})